<template>
  <div class="banxin list">
    <div class="title-top flex">
      <h3>正在进行</h3>
      <div class="count">{{arr.length}}</div>
    </div>
    <TodoListItem v-for="item in arr" :key="item.id" :data="item">
      <template v-slot:del>
        <button v-show="item.ischecked" @click="deledd(item.id)">删除</button>
      </template>
    </TodoListItem>
  </div>
</template>

<script>
import { mapMutations } from "vuex";
import TodoListItem from "../components/TodoListItem.vue";
export default {
  props: ["arr"],
  components: {
    TodoListItem,
  },
  methods: {
    ...mapMutations(["deled"]),
    deledd(id) {
      this.deled(id);
    },
  },
};
</script>
 
<style lang = "less" scoped>
.list .title-top {
  justify-content: space-between;
  align-items: center;
  height: 40px;
}

.title-top .count {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  background-color: #ccccff;
}
</style>